﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectOpenGXDW
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectOpenGXDW;

    public class ProjectGXDWOpenRecord_map : EntityMapping<ProjectGXDWOpenRecord>
    {
        public ProjectGXDWOpenRecord_map()
        {
            Property(x => x.CBR, map =>
            {
                map.Length(50);
            });

            Property(x => x.JBR, map =>
            {
                map.Length(50);
            });

            Property(x => x.JDR, map =>
            {
                map.Length(50);
            });

            Property(x => x.OpenDate, map =>
            {
                map.Length(50);
            });

            Property(x => x.OpenTitle, map =>
            {
                map.Length(500);
            });

            Bag(x => x.Details, map =>
            {
                map.Key(km => km.Column("RecordId"));
            }, act => act.OneToMany());

            //所属项目
            ManyToOne(x => x.Project, map =>
            {
                map.Column("ProjectId");
            });
        }
    }
}
